package com.cdl.service.impl;


import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cdl.dao.UserMapper;
import com.cdl.entity.User;
import com.cdl.service.UserService;
import com.github.pagehelper.PageInfo;

@Service("userServiceImpl")
public class UserServiceImpl extends BasicServiceImpl<User> implements UserService{
	private static Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);
	
	@Autowired
	UserMapper userMapper ;
	
	@Override
	public List<User> getList(User user) {
		logger.info("查询用户列表");
		List<User> u = userMapper.getList(user);
		return u;
	}

	@Override
	public User get(User user) {
		User u = userMapper.get(user);
		return u;
	}

	@Override
	public void add(User user) {
		userMapper.add(user);
	}

	@Override
	public void update(User user) {
		userMapper.update(user);
	}

	@Override
	public void delete(User user) {
		userMapper.delete(user);
	}

	@Override
	public PageInfo<User> getPage(User user) {
		return getPage(user.getPageNum(),user.getPageSize(),user);
	}

	
	
}
